<?
class ListProvinceForm extends Form
{
	function ListProvinceForm()
	{
		Form::Form('ListProvinceForm');
		
        $this->link_css("style/paging.css");
	}
	
	function on_submit()
	{
	}
	
	function draw()
	{
		global $display;
        $display->add("WEB_DIR",WEB_DIR);
        
        $item_per_page = 50;

		$this->beginForm(false,"post",false,Url::build_current());
        $all_location = Db_Location::getAllCities();
        $total_location = count($all_location);

        $page_no = (Url::getInt('page_no')<=1)?0:(Url::getInt('page_no')-1);
        $offset = $page_no*$item_per_page;
        $location = Db_Location::showLocationPagination($offset,$item_per_page);

        $display->add('hover',ECLib::mouse_hover('#F7F7F7',true));
		$display->add('items',$location);
        $display->add('paging', ECPaging::paging($limit, $total_location, $item_per_page));
		$display->add('total_row',$total_location);
		
		$display->output('ProvinceList');
		$this->endForm();
	}
}
?>